package org.lc.stk.service.baseInfo;

import java.util.List;

import org.lc.stk.model.baseInfo.Department;
import org.lc.stk.web.dto.department.CreateDepartmentRequest;
import org.lc.stk.web.dto.department.DepartmentQuery;
import org.lc.stk.web.dto.department.UpdateDepartmentRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

public interface DepartmentService {
    
    Department create(CreateDepartmentRequest request);
    
    Department update(UpdateDepartmentRequest request);
    
    void delete(Integer id);
    
    Department getById(Integer id);
    
    List<Department> getAll();
    
    List<Department> getTree();
    
    List<Department> getByParentId(Integer parentId);
    
    boolean isNameExists(String name, Integer excludeId);
    
    boolean isCodeExists(String code, Integer excludeId);
    
    Page<Department> query(DepartmentQuery query, Pageable pageable);
}